﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PrinterBudi.Persistence;

namespace PrinterBudi.Desktop
{
    public partial class FormAddTransaction : Form
    {
        List<PBUser> lpr;
        public FormAddTransaction()
        {
            lpr = PBUserModel.ReadAllUser();
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnLoad_Click(object sender, EventArgs e)
        {
            cbUser.Items.Clear();
            foreach (PBUser pu in lpr)
                cbUser.Items.Add(pu.Name);
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PBTransactionModel.Create("10/10/2010", "abc", "abc", "abc", "abc", 40, "abc", "def", 4, "10/10/2010", lpr[cbUser.SelectedIndex]);
            PBTransactionModel.Update(PBTransactionModel.Read(1));
        }
    }
}
